package cn.kgc.sacla
object ClassDemo08 {
  //特质表示性别
  trait Sex
  //定义枚举Male表示男
  case object Male extends Sex
  //定义枚举Female表示女
  case object Female extends Sex

  //定义Person样例类，属性：姓名和性别
  case class Person(name:String,var sex:Sex)

  def main(args: Array[String]): Unit = {
    //创建Person对象
    val p = Person("张三",Female)
    println(p)
  }
}
